<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" >
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
		<meta name="format-detection" content="telephone=no" />
    <title>商品确认页</title>
    <link rel="stylesheet" href="css/style.css">
		<link rel="stylesheet" href="css/index.css">
		<script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/public.js"></script>
</head>
<body style="background: #f7f7f7;">

	<!--兑换商品信息-->
<div class="order">
 	
		<div class="entity">* 该商品为实物，请仔细填写收货信息</div>
		
		<div class="from">
			<div class="from-list"><label>姓名</label><input type="text" placeholder="请输入您的收货人名称" id="name"></div>
			<div class="from-list"><label>手机号</label><input type="number" placeholder="请输入您的收货人手机号" id="iphone"></div>
			<div class="from-list"><label>收货地址</label><input type="text" placeholder="请输入您的地址" id="address"></div>
			<div class="from-list bd-b"><label>备注</label><input type="text" placeholder="请添加您的备注" id="remark"></div>
		</div>
		
		<button class="affirm">确认兑换</button>
	</div>
	<!--提示框-->
	<div class="item">
		<div class="hint">
			<div class="hint-pic"><img src="image/err-tip.png" class="tip"></div>
			<p class="hint-erro">亲，先去完成实名认证（任务>身份认证）再来兑换哦～</p>
			<input type="button" class="hint-btn" value="我知道了">
		</div>
	</div>
  
</body>
<script>
	$(function(){
		var url = 'http://ysapi.jin315.com/',
				str = '',
				goodsid = getQueryString('goodsid'); //获取userid
		$.ajax({
			type:"GET",
			url:url+"getGoodsDetailById.ashx", 
			data:{goodsId:goodsid},
			dataType:"jsonp", 
			jsonp:"jsonpCallback",
			jsonpCallback:"jsonpCallback",
			success:function(data){
				if(data && data.code == 200){
					var data = data.data.goodsDetail;
					
					str+='<div class="order-list mr-b">'+
									'<div class="order-wrap">'+
										'<div class="order-pic">'+
											'<img src='+data.HeaderPic+' alt='+data.GoodTitle+'>'+
										'</div>'+
										'<div class="order-body">'+
											'<h3 class="order-title">'+data.GoodTitle+'</h3>'+
											'<p class="order-y">成交价（云钻数）</p>'+
											'<p class="order-num">'+
												'<span class="total">'+data.PriceYunZuan+'</span>'+
											'</p>'+
										'</div>'+
									'</div>'+
									'<p class="order-desc">'+data.ShortDesc+'</p>'+
								'</div>';
					$('.order').prepend(str);
						
					if(data.IsShiwu == 0){
						$('.entity').text('* 该商品为虚拟物品');
						$('.from').css('display','none');
				
					}else if(data.IsShiwu == 1){
						$('.entity').text('* 该商品为实物，请仔细填写收货信息');
						$('.from').css('display','block');
					}
				}
			},
			eero:function(){
				console.log(data.msg);
			}
		})
		
		// 我知道了
		$('.hint-btn').click(function(){
			$('.item').hide();
		})
		
		// 正则匹配手机号
		function checkMobile(str) {
				var re = /^1[3|4|5|7|8|9][0-9]{9}$/;
				if (re.test(str)) {
						return true
				} else {
						return false
				}
		}
	})
</script>
</html>